Expand description

Traits for generic numeric constants

Like the traits Zero and One from the num crate, but for all natural numbers up to and including 100. Allows doing generic arithmetic without having to do casts.

Without this crate you’d need to do something like:

2u8.into() * 3u8.into() + 4u8.into()

Which is okay, but obfuscates a bit what the intent is.

With this crate you can do something like this:

T::two() * T::three() + T::four()

The traits are implemented for all standard numeric types, as well as a blanket implementation for num::Complex<T>, where T is any of the standar numeric types.

Structs

  • A complex number in Cartesian form.

Traits

  • Returns the constant value for the number eight
  • Returns the constant value for the number eighteen
  • Returns the constant value for the number eighty
  • Returns the constant value for the number eighty_eight
  • Returns the constant value for the number eighty_five
  • Returns the constant value for the number eighty_four
  • Returns the constant value for the number eighty_nine
  • Returns the constant value for the number eighty_one
  • Returns the constant value for the number eighty_seven
  • Returns the constant value for the number eighty_six
  • Returns the constant value for the number eighty_three
  • Returns the constant value for the number eighty_two
  • Returns the constant value for the number eleven
  • Returns the constant value for the number fifteen
  • Returns the constant value for the number fifty
  • Returns the constant value for the number fifty_eight
  • Returns the constant value for the number fifty_five
  • Returns the constant value for the number fifty_four
  • Returns the constant value for the number fifty_nine
  • Returns the constant value for the number fifty_one
  • Returns the constant value for the number fifty_seven
  • Returns the constant value for the number fifty_six
  • Returns the constant value for the number fifty_three
  • Returns the constant value for the number fifty_two
  • Returns the constant value for the number five
  • Returns the constant value for the number forty
  • Returns the constant value for the number forty_eight
  • Returns the constant value for the number forty_five
  • Returns the constant value for the number forty_four
  • Returns the constant value for the number forty_nine
  • Returns the constant value for the number forty_one
  • Returns the constant value for the number forty_seven
  • Returns the constant value for the number forty_six
  • Returns the constant value for the number forty_three
  • Returns the constant value for the number forty_two
  • Returns the constant value for the number four
  • Returns the constant value for the number fourteen
  • Returns the constant value for the number nine
  • Returns the constant value for the number nineteen
  • Returns the constant value for the number ninety
  • Returns the constant value for the number ninety_eight
  • Returns the constant value for the number ninety_five
  • Returns the constant value for the number ninety_four
  • Returns the constant value for the number ninety_nine
  • Returns the constant value for the number ninety_one
  • Returns the constant value for the number ninety_seven
  • Returns the constant value for the number ninety_six
  • Returns the constant value for the number ninety_three
  • Returns the constant value for the number ninety_two
  • Defines a multiplicative identity element for Self.
  • Returns the constant value for the number one_hundred
  • Returns the constant value for the number seven
  • Returns the constant value for the number seventeen
  • Returns the constant value for the number seventy
  • Returns the constant value for the number seventy_eight
  • Returns the constant value for the number seventy_five
  • Returns the constant value for the number seventy_four
  • Returns the constant value for the number seventy_nine
  • Returns the constant value for the number seventy_one
  • Returns the constant value for the number seventy_seven
  • Returns the constant value for the number seventy_six
  • Returns the constant value for the number seventy_three
  • Returns the constant value for the number seventy_two
  • Returns the constant value for the number six
  • Returns the constant value for the number sixteen
  • Returns the constant value for the number sixty
  • Returns the constant value for the number sixty_eight
  • Returns the constant value for the number sixty_five
  • Returns the constant value for the number sixty_four
  • Returns the constant value for the number sixty_nine
  • Returns the constant value for the number sixty_one
  • Returns the constant value for the number sixty_seven
  • Returns the constant value for the number sixty_six
  • Returns the constant value for the number sixty_three
  • Returns the constant value for the number sixty_two
  • Returns the constant value for the number ten
  • Returns the constant value for the number thirteen
  • Returns the constant value for the number thirty
  • Returns the constant value for the number thirty_eight
  • Returns the constant value for the number thirty_five
  • Returns the constant value for the number thirty_four
  • Returns the constant value for the number thirty_nine
  • Returns the constant value for the number thirty_one
  • Returns the constant value for the number thirty_seven
  • Returns the constant value for the number thirty_six
  • Returns the constant value for the number thirty_three
  • Returns the constant value for the number thirty_two
  • Returns the constant value for the number three
  • Returns the constant value for the number twelve
  • Returns the constant value for the number twenty
  • Returns the constant value for the number twenty_eight
  • Returns the constant value for the number twenty_five
  • Returns the constant value for the number twenty_four
  • Returns the constant value for the number twenty_nine
  • Returns the constant value for the number twenty_one
  • Returns the constant value for the number twenty_seven
  • Returns the constant value for the number twenty_six
  • Returns the constant value for the number twenty_three
  • Returns the constant value for the number twenty_two
  • Returns the constant value for the number two
  • Defines an additive identity element for Self.